package com.sakura.gateway.props;

import io.jsonwebtoken.JwtException;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;


@Data
@ConfigurationProperties("gateway.token")
public class JwtProperties {
    private Boolean state = Boolean.FALSE;
    private Boolean single = Boolean.FALSE;
    private String signKey = "";
    public String getSignKey() {
        if (this.signKey.length() < 32) {
            throw new JwtException("请配置 blade.token.sign-key 的值, 长度32位以上");
        }
        return this.signKey;
    }

}
